package com.github.aloxc.plugin.restplus.test;

import com.github.aloxc.plugin.restplus.method.HttpMethod;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.jetbrains.annotations.NotNull;

import java.net.URI;
/**
 * 构建post body‘的client
 * @author leero
 */
public class HttpClientRequestWithBody
        extends HttpEntityEnclosingRequestBase {
    private final HttpMethod myMethod;

    public HttpClientRequestWithBody(@NotNull HttpMethod method, @NotNull String uri) {
        setURI(URI.create(uri));
        this.myMethod = HttpMethod.POST;
    }


    @Override
    public String getMethod() {
        return this.myMethod.name().toUpperCase();
    }
}